package com.lorenzogao.pley.ui.presenter

import com.lorenzogao.pley.bean.IndexBean
import com.lorenzogao.pley.common.rx.RxErrorHandler
import com.lorenzogao.pley.common.rx.RxHttpReponseCompat
import com.lorenzogao.pley.common.rx.subscriber.ProgressSubcriber
import com.lorenzogao.pley.ui.data.AppInfoModel
import com.lorenzogao.pley.ui.presenter.contract.AppInfoContract
import javax.inject.Inject

/**
 * Created by GanLanPing
 * data:2017/12/23
 * time:13:26
 * 邮箱:2508719070@qq.com
 * Description:
 */

class RecommendPresenter @Inject constructor(mModel: AppInfoModel, mView: AppInfoContract.View, errorHandler: RxErrorHandler) : BasePresenter<AppInfoModel, AppInfoContract.View>(mModel, mView) {



    fun requestDatas() {
        mModel!!.index().compose(RxHttpReponseCompat.compatResult())
                .subscribe(object : ProgressSubcriber<IndexBean>(mContext!!, mView!!) {
                    override fun onNext(t: IndexBean?) {
                        if (t != null) {
                            mView!!.showResult(t)
                        }
                    }

                })


    }




}




